﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Main.Master" AutoEventWireup="true"
    CodeBehind="TerminalManage.aspx.cs" Inherits="ATW.MT.BaseManage.TerminalManage" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cp01" runat="server">
    <div class="main_hd">
        <h2 style="padding: 0px 20px;">
            App用户管理
        </h2>
        <div class="title_tab" id="topTab">
            <ul>
                <li>用户名：&nbsp;<input type="text" id="txtName" runat="server" />用户类别： &nbsp;<asp:DropDownList
                    runat="server" ID="ddlUserType">
                    <asp:ListItem Text="全部" Value=""></asp:ListItem>
                    <asp:ListItem Text="外部" Value="1"></asp:ListItem>
                    <asp:ListItem Text="内部" Value="2"></asp:ListItem>
                </asp:DropDownList>
                    &nbsp; &nbsp; &nbsp;
                    <asp:Button runat="server" ID="btnSearch" Text="搜索" class="MaintenanceButton" OnClick="btnSearch_Click"
                        Style="background: #d91913; outline: none; border: none; color: White; padding: 5px 20px;" />
                    <asp:LinkButton runat="server" ID="lbnAddUser" OnClick="lbnAddUser_Click" Style="color: White;
                        text-decoration: none" CssClass="queryButton">
                            新增内部用户
                    </asp:LinkButton>
                    &nbsp; &nbsp; &nbsp; </li>
                <li runat="server" id="liAddUser" visible="false" style="margin-top: 12px">用户名：&nbsp;<asp:TextBox
                    runat="server" ID="txtNewName"></asp:TextBox>
                    真实姓名：&nbsp;<asp:TextBox runat="server" ID="txtTrueName"></asp:TextBox>
                    密码：&nbsp;<asp:TextBox runat="server" ID="txtPwd" Width="100px" TextMode="Password"></asp:TextBox>
                    确认密码：&nbsp;<asp:TextBox runat="server" Width="100px" ID="txtPwd2" TextMode="Password"></asp:TextBox>
                    &nbsp; &nbsp; &nbsp;
                    <asp:LinkButton runat="server" ID="lbnSaveUser" OnClick="lbnSaveUser_Click" CssClass="queryButton"
                        Style="color: White; text-decoration: none">新增</asp:LinkButton>
                </li>
            </ul>
            <ul>
                <li>
                    <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Bold="true"></asp:Label></li>
            </ul>
        </div>
        <asp:Repeater ID="rpList" runat="server">
            <HeaderTemplate>
                <table width="95%" border="0" cellpadding="0" cellspacing="0" style="font-size: 14px"
                    class="queryResultTable">
                    <tr>
                        <th>
                            账号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            类别
                        </th>
                        <th>
                            是否认证
                        </th>
                        <th>
                            认证类型
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%#Eval("tauLoginId").ToString()%>
                    </td>
                    <td>
                        <%#Eval("tauName").ToString()%>
                    </td>
                    <td>
                        <%#Eval("tauType").ToString()=="1"?"外部":Eval("tauType").ToString()=="2"?"内部":"未知"%>
                    </td>
                    <td>
                        <%#Eval("tauIsAuthorised").ToString() == "0" ? "未授权" : "已授权"%>
                    </td>
                    <td>
                        <asp:LinkButton runat="server" ID="Modify" OnClick="lbnModify_Click" CommandArgument='<%#Eval("TAUID").ToString()%>'>
                            操作
                        </asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <cc1:AspNetPager ID="AspNetPager1" Style="float: right" runat="server" PageSize="10"
            AlwaysShow="true" CssClass="paginator" CurrentPageButtonClass="cpb" FirstPageText="首页"
            PagingButtonSpacing="0" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"
            OnPageChanged="AspNetPager1_pageChanged">
        </cc1:AspNetPager>
    </div>
    <div id="divAdd" style="display: none;">
        <div class="tc_header">
            <h2>
                编辑授权</h2>
            <a id="hideAdd">
                <img src="../images/chacha.png" width="13" height="13"></a>
        </div>
        <div class="tc_content">
            <div class="tanchu03" style="max-width: 400px">
                <asp:Repeater ID="rpList2" runat="server">
                    <HeaderTemplate>
                        <%--                        <table cellpadding="0" cellspacing="5" style="margin: 5px">
                            <tr>
                                <th>
                                    授权名
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>--%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div id="" style="width: 100px; float: left">
                            <div>
                                <input type="checkbox" id="Information<%#Eval("TICID").ToString()%>" name="Information"
                                    value="<%#Eval("TICID").ToString()%>" />&nbsp;<%#Eval("ticName").ToString()%></div>
                        </div>
                    </ItemTemplate>
                    <FooterTemplate>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <div style="clear: both">
            </div>
            <div style="text-align: center">
                <asp:Button runat="server" OnClientClick="bindChange()" ID="Button1" Text="确认" class="MaintenanceButton"
                    OnClick="btnChange_Click" Style="background: #d91913; outline: none; border: none;
                    color: White; padding: 5px 20px;" /></div>
        </div>
    </div>
    <div id="divMsg" style="display: none;">
        <div class="tc_header">
            <h2>
                提示</h2>
            <a id="hideMsg">
                <img src="../images/chacha.png" width="13" height="13"></a>
        </div>
        <div class="tc_content">
            <div class="tanchu03" style="">
                <p id="msgContent">
                </p>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="hftauaTauId" Value="" runat="server" />
    <asp:HiddenField ID="hfInformation" Value="" runat="server" />
    <asp:HiddenField ID="hfChangeInformation" Value="" runat="server" />
    <script type="text/javascript">
        function bindChange() {
            var arr = [];
            $("input[name=Information]").each(function () {
                if ($(this).is(':checked')) {
                    arr.push($(this).val());
                }
            })
            $("#<%=hfChangeInformation.ClientID %>").val(arr.toString());
        }
        function modify() {
            var arr = $("#<%=hfInformation.ClientID %>").val().split('-');
            for (var i = 0; i < arr.length - 1; i++) {
                $("input[name=Information][value=" + arr[i] + "]").attr("checked", "true");
            }

        }
    </script>
</asp:Content>
